--6. Create a function that sorts a list of lists based on the length of each sublist. (You
--may want to look at the sortBy function from the Data.List module.)

--Prelude> :m + Data.List
--Prelude Data.List> :info sortBy
--sortBy :: (a -> a -> Ordering) -> [a] -> [a]
        -- Defined in ‘base-4.12.0.0:Data.OldList’


--Prelude Data.List> :m + Data.OldList

-- <no location info>: error:
--    Could not load module ‘Data.OldList’
--    it is a hidden module in the package ‘base-4.12.0.0’

import Data.List
        
--compareListLength x y = length x < length y
compareListLength x y = compare x y

sortListOfLists xs = sortBy compareListLength xs


